const mongoose = require("mongoose");

module.exports = mongoose.model("user", {
  //用户名
  username: {
    type: String,
    required: true,
  },
  // 用户密码
  password: {
    type: String,
    required: true,
  },
  //用户电话号码
  telephone: {
    type: Number,
    require: true,
  },
  //用户头像
  avatar: {
    type: String,
    default:
      "https://th.bing.com/th/id/R.69b9d22e860788172b4807bafa4d0a2e?rik=iKS%2fM9ljIQJf7A&pid=ImgRaw&r=0",
  },
  //创建时间
  time: {
    type: String,
    // required: true,
  },
  part: {
    type: String,
  },
  LogTime: {
    type: String,
    require: true,
  },
  consumption: {
    type: Number,
    require: true,
  },
  type: {
    type: String,
    default: 1,
  },
});
